package com.winit.core.configuration.syncer;

import com.winit.core.ci.vcs.VCS;
import com.winit.core.ci.vcs.exception.VCSException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by wangjian on 16/8/4.
 */
public class VCSFileSyncer implements ConfigFileSyncer {

    private static final Logger logger = LoggerFactory.getLogger(VCSFileSyncer.class);

    private VCS vcs;

    public VCSFileSyncer(VCS vcs){
        this.vcs = vcs;
    }

    @Override
    public void doSynce() {
        try {
            this.vcs.doUpdate();
        } catch (VCSException e) {
            e.printStackTrace();
            logger.error("更新configuration异常,e:"+e.getMessage());
        }
    }
}
